< previous page page_484 next page >

Page 484
Random Access with Seek
To move from record to record, use the Seek statement. The Seek statement has two parameters, the file number and record number, as shown here:
Seek #1,3
The preceding line of code causes the next Put or Get to access record number 3.
INI Files
INI files (pronounced ''any files" by us southerners) are useful for storing program information and user settings. An INI file is basically a text file with a simple structure that allows you to save and retrieve specific pieces of information; its filename extension is INI, short for initialization. By storing information in an INI file, you can avoid hard-coding values in your program. This way, you can easily change values without recompiling the program. In the following sections, you will look at some possible uses for INI files and discover what you need to do to use them in a program.
Understanding INI Files
The structure of INI files is simple. INI files can be viewed and edited with Notepad, or any other text editor. A sample INI file is shown in Figure 21.7.
0484-01.jpg
Figure 21.7
INI files can be used to store user settings
and other information in an organized manner.
The three elements to an INI file are sections, keys, and values. (Microsoft calls a section an application; the reason for this involves the history of INI files when an application stored its own settings in WIN.INI.) The parts of an INI file are summarized in Table 21.3.

 
< previous page page_484 next page >